﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TitaniumAS.Opc.Client;
using TitaniumAS.Opc.Client.Da;

namespace MolyMart.WithOPC
{

    public struct OpcServer
    {
        public OpcServerDefinition OpcServerDefinition;
        public OpcDaServer OpcDaServer;
        public ServerState ServerState;
        public OpcDaGroup OpcDaGroup;
        public OpcDaItemResult[] OpcDaItemResults;
        public OpcDaItemValue[] OpcDaItemValues;
        public OpcDaItemDefinition[] OpcDaItemDefinitions;
        public long LastReadTime;
        public long LastTryConnectTime;
        public long LastConnectTime;
        public string StateDescribion;
    }

    public struct OpcServerDefinition
    {
        public string Id;
        public string HostName;
        public string ServerName;
        public string Case;
        public Dictionary<string, string> ValuesNameDictionary;
        public List<OpcItemDefinition> Items;
    }

    public struct OpcItemDefinition
    {
        public string Item;
        public string Name;
        public string Type;
    }

    public enum ServerState
    {
        Initialized = 0xAA,
        Connected = 0xBB,
        ItemsAdded = 0xCC,
        CanBeRead = 0xDD
    }

}
